﻿<%@ Control Language="C#" %>
<script runat="server">
    
    private int top_size = 0;
    private int lang = 1;
    private string s_mode = "_ss";
    private int cid = 0;
    /// <summary>
    /// 栏目信息集
    /// </summary>
    public Types types=new Types();
    protected void Page_Load(object sender, EventArgs e)
    {
        /* 如果栏目ID未绑定，尝试地址栏获取ID */
        if(Cid==0)
            Cid = Utils.GetQueryString("cid", 0);
        /* 绑定栏目相关信息集 */
        if(Cid!=0)
            types = new Types(Cid);
        /* 如果语言ID未绑定，尝试地址栏获取  */
        if (Item_Lang == 1)
            Item_Lang = Utils.GetQueryString("lang", 1);

        Text news = new Text();
        Repeater_List.DataSource = news.List(Cid, Top_Size, Item_Lang,"home");
        Repeater_List.DataBind();
    }
    /// <summary>
    /// 显示的数量 , 默认值：top_size
    /// </summary>
    public int Top_Size
    {
        get { return top_size; }
        set { top_size = value; }
    }
    /// <summary>
    /// 语言编号，默认值lang
    /// </summary>
    public int Item_Lang
    {
        get { return lang; }
        set { lang = value; }
    }
    /// <summary>
    /// 图片缩略图后缀路径,默认值s_mode
    /// </summary>
    public string S_Mode
    {
        get { return s_mode; }
        set { s_mode = value; }
    }
    /// <summary>
    /// 栏目ID
    /// </summary>
    public int Cid
    {
        get { return cid; }
        set { cid = value; }
    }
</script>

<!--HTML 部分-->
<h3 class="h3_<%=Cid %>"><a href="news-list.aspx?cid=<%=Cid %>"><%=types.Name %></a></h3>
<ul class="li_<%=Cid %>">
<asp:Repeater runat="server" ID="Repeater_List">
    <ItemTemplate>
        <li class="li_<%#Eval("Item_Id") %>">
            <a href="News-View.aspx?id=<%#Eval("Item_Id") %>&lang=<%=Item_Lang %>">
                <code><%#Eval("Item_Time", "{0:yyyy/MM}")%><i><%#Eval("Item_Time", "{0:dd}")%></i></code>
                <img src="../DataFile/TextLogo/<%#Eval("Create_Time", "{0:yyyyMM}")%>/<%#Eval("Create_Time", "{0:ddHHmmss}")%><%=S_Mode %>.jpg" />
                <h4><%#Eval("Item_Title")%></h4>
                <p class="text"><%#Eval("Item_Summary")%></p>
            </a>
        </li>
    </ItemTemplate>
</asp:Repeater>
</ul>